Handbook
Glossary
new-user ( user provider -- user/f )
Furnace framework
»
Furnace authentication
»
Authentication providers
»
Authentication provider protocol
Prev:
get-user ( username provider -- user/f )
Next:
update-user ( user provider -- )
Vocabulary
furnace
.
auth
.
providers
Inputs
user
an
user
provider
an authentication provider
Outputs
user/f
an
user
or
f
Generic word contract
Adds a new user to the authentication provider. Outputs
f
if a user with this username already exists.
Definition
IN:
furnace.auth.providers
GENERIC:
new-user
( user provider -- user/f )
Methods
USING:
accessors
furnace.auth.providers
furnace.auth.providers.couchdb
furnace.auth.providers.couchdb.private
kernel
namespaces
;
M:
couchdb-auth-provider
new-user
couchdb-auth-provider
[
dup
(new-user)
[
username>>
couchdb-auth-provider
get
get-user
]
[
drop
f
]
if
]
with-variable
;
USING:
furnace.auth.providers
furnace.auth.providers.null
kernel
;
M:
no-users
new-user
2drop
f
;
USING:
accessors
db
db.tuples
furnace.auth.providers
furnace.auth.providers.db
kernel
;
M:
users-in-db
new-user
drop
[
user
new
over
username>>
>>username
select-tuple
[
drop
f
]
[
dup
insert-tuple
]
if
]
with-transaction
;
USING:
accessors
assocs
furnace.auth.providers
furnace.auth.providers.assoc
kernel
;
M:
users-in-memory
new-user
[
dup
username>>
]
dip
assoc>>
2dup
key?
[
3drop
f
]
[
pick
[
set-at
]
dip
]
if
;