The reblocks-auth Reference Manual

This is the reblocks-auth Reference Manual, version 0.11.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 08 19:27:04 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 reblocks-auth

A system to add an authentication to the Reblocks based web-site.

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-auth/

Source Control

(GIT https://github.com/40ants/reblocks-auth)

Bug Tracker

https://github.com/40ants/reblocks-auth/issues

License

Unlicense

Long Description

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-40README-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

# reblocks-auth - A system to add an authentication to the Reblocks based web-site.

<a id="reblocks-auth-asdf-system-details"></a>

## REBLOCKS-AUTH ASDF System Details

* Description: A system to add an authentication to the Reblocks based web-site.
* Licence: Unlicense
* Author: Alexander Artemenko <svetlyak.40wt@gmail.com>
* Homepage: [https://40ants.com/reblocks-auth/][e462]
* Bug tracker: [https://github.com/40ants/reblocks-auth/issues][4f85]
* Source control: [GIT][1668]
* Depends on: [alexandria][8236], [cl-strings][2ecb], [dexador][8347], [jonathan][6dd8], [local-time][46a1], [log4cl][7f8b], [mailgun][ef16], [mito][5b70], [quri][2103], [reblocks][184b], [reblocks-lass][28e0], [reblocks-ui][4376], [secret-values][cd18], [serapeum][c41d], [uuid][d6b3], [yason][aba2]

[![](https://github-actions.40ants.com/40ants/reblocks-auth/matrix.svg?only=ci.run-tests)][2ba2]

![](http://quickdocs.org/badge/reblocks-auth.svg)

Reblocks-auth is a system for adding authentication for your Reblocks application. It allows users to login using multiple ways. Right now GitHub is only supported but the list will be extended.

This system uses [Mito][c7c4] as a storage to store data about users and their data from service providers. Each user has a unique nickname and an optional email. Also, one or more identity providers can be bound to each user account.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40INSTALLATION-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

## Installation

You can install this library from Quicklisp, but you want to receive updates quickly, then install it from Ultralisp.org:

“‘
(ql-dist:install-dist "http://dist.ultralisp.org/"
:prompt nil)
(ql:quickload :reblocks-auth)
“‘
<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40EXAMPLE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

## Example App

I’ve made an example application to demonstrate how does [‘reblocks-auth‘][ac3a] system work.
To start this example application, run this code in the ‘REPL‘:

“‘
(asdf:load-system :reblocks-auth-example)

(reblocks-auth-example/server:start :port 8080)
“‘
When you’ll open the http://localhost:8080/ you will see this simple website:

![](https://storage.yandexcloud.net/40ants-blog-images/reblocks-auth-example.gif)

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40USAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

## Usage

This system provides a way for user authentifications. Each user is represented in the database
using [‘reblocks-auth/models:user‘][05f7] model user can be bound to one or more "social profiles" -
[‘reblocks-auth/models:social-profile‘][d9d6]. For example, if user logged in via GitHub, then
database will store one "user" record and one "social-profile" record. Each social profile
can hold additional information in it’s metadata slot.

To use this system, you have to define two routes which will be responsible for login and logout.
On each route you have to render either [‘reblocks-auth:login-processor‘][0dc2] or [‘reblocks-auth:logout-processor‘][4d0d] widgets.

Usually you can define your routes like this ([‘reblocks-navigation-widget:defroutes‘][5f0d] is used here):

“‘
(defroutes routes
("/" (make-page-frame
(make-landing-page)))
("/login"
(make-page-frame
(reblocks-auth:make-login-processor)))
("/logout"
(make-page-frame
(reblocks-auth:make-logout-processor))))
“‘
This code will render a set up buttons to login through enabled service providers.
Enabled service providers are listed in [‘reblocks-auth:*enabled-services*‘][ac4c] variable.

Login processor does two things:

* renders buttons for enabled service providers calling [‘reblocks-auth/button:render‘][5d34] generic-function.
* service processor is executed when user clicks a "login" button. For example GitHub processor
redirects to https://github.com/login/oauth/authorize
* when user comes back to /login page, service processor gets or creates entries in the database
and stores current user in the session.
* after this, any code can retrieve current user by a call to [‘reblocks-auth/models:get-current-user‘][8c78].

Logout processor renders a "logout" button and when user clicks on it, removes user from the current session.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40API-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

## API

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FAUTH-3FPACKAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

### REBLOCKS-AUTH/AUTH

<a id="x-28-23A-28-2818-29-20BASE-CHAR-20-2E-20-22REBLOCKS-AUTH-2FAUTH-22-29-20PACKAGE-29"></a>

#### [package](7bb8) ‘reblocks-auth/auth‘

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FAUTH-3FGenerics-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Generics

<a id="x-28REBLOCKS-AUTH-2FAUTH-3AAUTHENTICATE-20GENERIC-FUNCTION-29"></a>

##### [generic-function](0067) ‘reblocks-auth/auth:authenticate‘ service &rest params &key code

Called when user had authenticated in the service and returned
to our site.

All ‘GET‘ arguments are collected into a plist and passed as params.

Should return two values a user and a flag denotifing if user was just created.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FBUTTON-3FPACKAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

### REBLOCKS-AUTH/BUTTON

<a id="x-28-23A-28-2820-29-20BASE-CHAR-20-2E-20-22REBLOCKS-AUTH-2FBUTTON-22-29-20PACKAGE-29"></a>

#### [package](c6c8) ‘reblocks-auth/button‘

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FBUTTON-3FGenerics-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Generics

<a id="x-28REBLOCKS-AUTH-2FBUTTON-3ARENDER-20GENERIC-FUNCTION-29"></a>

##### [generic-function](2b0e) ‘reblocks-auth/button:render‘ service &key retpath

Renders a button for given service.
Service should be a keyword like :github or :facebook.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FCONDITIONS-3FPACKAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

### REBLOCKS-AUTH/CONDITIONS

<a id="x-28-23A-28-2824-29-20BASE-CHAR-20-2E-20-22REBLOCKS-AUTH-2FCONDITIONS-22-29-20PACKAGE-29"></a>

#### [package](957c) ‘reblocks-auth/conditions‘

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FCONDITIONS-3FClasses-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Classes

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FCONDITIONS-24UNABLE-TO-AUTHENTICATE-3FCLASS-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

##### UNABLE-TO-AUTHENTICATE

<a id="x-28REBLOCKS-AUTH-2FCONDITIONS-3AUNABLE-TO-AUTHENTICATE-20CONDITION-29"></a>

###### [condition](da77) ‘reblocks-auth/conditions:unable-to-authenticate‘ ()

**Readers**

<a id="x-28REBLOCKS-AUTH-2FCONDITIONS-3AGET-MESSAGE-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-AUTH-2FCONDITIONS-3AUNABLE-TO-AUTHENTICATE-29-29"></a>

###### [reader](da77) ‘reblocks-auth/conditions:get-message‘ (unable-to-authenticate) (:message)

<a id="x-28REBLOCKS-AUTH-2FCONDITIONS-3AGET-REASON-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-AUTH-2FCONDITIONS-3AUNABLE-TO-AUTHENTICATE-29-29"></a>

###### [reader](da77) ‘reblocks-auth/conditions:get-reason‘ (unable-to-authenticate) (:reason = ’nil)

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FCORE-3FPACKAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

### REBLOCKS-AUTH/CORE

<a id="x-28-23A-28-2818-29-20BASE-CHAR-20-2E-20-22REBLOCKS-AUTH-2FCORE-22-29-20PACKAGE-29"></a>

#### [package](8c4b) ‘reblocks-auth/core‘

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FCORE-3FClasses-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Classes

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FCORE-24LOGIN-PROCESSOR-3FCLASS-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

##### LOGIN-PROCESSOR

<a id="x-28REBLOCKS-AUTH-2FCORE-3ALOGIN-PROCESSOR-20CLASS-29"></a>

###### [class](0603) ‘reblocks-auth/core:login-processor‘ (widget)

This widget should be rendered to process user’s login.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FCORE-24LOGOUT-PROCESSOR-3FCLASS-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

##### LOGOUT-PROCESSOR

<a id="x-28REBLOCKS-AUTH-2FCORE-3ALOGOUT-PROCESSOR-20CLASS-29"></a>

###### [class](811c) ‘reblocks-auth/core:logout-processor‘ (widget)

This widget should be rendered to process user’s logout.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FCORE-3FGenerics-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Generics

<a id="x-28REBLOCKS-AUTH-2FCORE-3ARENDER-LOGIN-PAGE-20GENERIC-FUNCTION-29"></a>

##### [generic-function](a47a) ‘reblocks-auth/core:render-login-page‘ app &key retpath

By default, renders a list of buttons for each allowed authentication method.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FCORE-3FFunctions-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Functions

<a id="x-28REBLOCKS-AUTH-2FCORE-3AMAKE-LOGIN-PROCESSOR-20FUNCTION-29"></a>

##### [function](7208) ‘reblocks-auth/core:make-login-processor‘

<a id="x-28REBLOCKS-AUTH-2FCORE-3AMAKE-LOGOUT-PROCESSOR-20FUNCTION-29"></a>

##### [function](9d8c) ‘reblocks-auth/core:make-logout-processor‘

<a id="x-28REBLOCKS-AUTH-2FCORE-3ARENDER-BUTTONS-20FUNCTION-29"></a>

##### [function](d46d) ‘reblocks-auth/core:render-buttons‘ &key retpath

Renders a row of buttons for enabled service providers.

Optionally you can specify ‘RETPATH‘ argument with an ‘URI‘ to return user
after login.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FCORE-3FVariables-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Variables

<a id="x-28REBLOCKS-AUTH-2FCORE-3A-2AALLOW-NEW-ACCOUNTS-CREATION-2A-20-28VARIABLE-29-29"></a>

##### [variable](52c4) ‘reblocks-auth/core:*allow-new-accounts-creation*‘ t

When True, a new account will be created. Otherwise only already existing users can log in.

<a id="x-28REBLOCKS-AUTH-2FCORE-3A-2AENABLED-SERVICES-2A-20-28VARIABLE-29-29"></a>

##### [variable](09e2) ‘reblocks-auth/core:*enabled-services*‘ (:github)

Set this variable to limit a services available to login through.

<a id="x-28REBLOCKS-AUTH-2FCORE-3A-2ALOGIN-HOOKS-2A-20-28VARIABLE-29-29"></a>

##### [variable](c9c9) ‘reblocks-auth/core:*login-hooks*‘ nil

Append a funcallable handlers which accept single argument - logged user.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FERRORS-3FPACKAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

### REBLOCKS-AUTH/ERRORS

<a id="x-28-23A-28-2820-29-20BASE-CHAR-20-2E-20-22REBLOCKS-AUTH-2FERRORS-22-29-20PACKAGE-29"></a>

#### [package](09d9) ‘reblocks-auth/errors‘

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FERRORS-3FClasses-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Classes

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FERRORS-24NICKNAME-IS-NOT-AVAILABLE-3FCLASS-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

##### NICKNAME-IS-NOT-AVAILABLE

<a id="x-28REBLOCKS-AUTH-2FERRORS-3ANICKNAME-IS-NOT-AVAILABLE-20CONDITION-29"></a>

###### [condition](163d) ‘reblocks-auth/errors:nickname-is-not-available‘ (error)

Signalled when there is already a user with given nickname.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FGITHUB-3FPACKAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

### REBLOCKS-AUTH/GITHUB

<a id="x-28-23A-28-2820-29-20BASE-CHAR-20-2E-20-22REBLOCKS-AUTH-2FGITHUB-22-29-20PACKAGE-29"></a>

#### [package](b908) ‘reblocks-auth/github‘

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FGITHUB-3FFunctions-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Functions

<a id="x-28REBLOCKS-AUTH-2FGITHUB-3AGET-SCOPES-20FUNCTION-29"></a>

##### [function](e341) ‘reblocks-auth/github:get-scopes‘

Returns current user’s scopes.

<a id="x-28REBLOCKS-AUTH-2FGITHUB-3AGET-TOKEN-20FUNCTION-29"></a>

##### [function](8cc0) ‘reblocks-auth/github:get-token‘

Returns current user’s GitHub token.

<a id="x-28REBLOCKS-AUTH-2FGITHUB-3ARENDER-BUTTON-20FUNCTION-29"></a>

##### [function](2c83) ‘reblocks-auth/github:render-button‘ &KEY (CLASS "button small") (SCOPES \*DEFAULT-SCOPES\*) (TEXT "Grant permissions") (RETPATH (GET-URI))

Renders a button to request more scopes.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FGITHUB-3FVariables-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Variables

<a id="x-28REBLOCKS-AUTH-2FGITHUB-3A-2ACLIENT-ID-2A-20-28VARIABLE-29-29"></a>

##### [variable](2dd0) ‘reblocks-auth/github:*client-id*‘ nil

‘OA‘uth client id

<a id="x-28REBLOCKS-AUTH-2FGITHUB-3A-2ADEFAULT-SCOPES-2A-20-28VARIABLE-29-29"></a>

##### [variable](dea4) ‘reblocks-auth/github:*default-scopes*‘ ("user:email")

A listo of default scopes to request from GitHub.

<a id="x-28REBLOCKS-AUTH-2FGITHUB-3A-2ASECRET-2A-20-28VARIABLE-29-29"></a>

##### [variable](1344) ‘reblocks-auth/github:*secret*‘ nil

‘OA‘uth secret. It might be a string or secret-values:secret-value.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FMODELS-3FPACKAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

### REBLOCKS-AUTH/MODELS

<a id="x-28-23A-28-2820-29-20BASE-CHAR-20-2E-20-22REBLOCKS-AUTH-2FMODELS-22-29-20PACKAGE-29"></a>

#### [package](f4b8) ‘reblocks-auth/models‘

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FMODELS-3FClasses-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Classes

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FMODELS-24SOCIAL-PROFILE-3FCLASS-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

##### SOCIAL-PROFILE

<a id="x-28REBLOCKS-AUTH-2FMODELS-3ASOCIAL-PROFILE-20CLASS-29"></a>

###### [class](8a32) ‘reblocks-auth/models:social-profile‘ (serial-pk-mixin dao-class record-timestamps-mixin)

Represents a User’s link to a social service.
User can be bound to multiple social services.

**Readers**

<a id="x-28REBLOCKS-AUTH-2FMODELS-3APROFILE-METADATA-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-AUTH-2FMODELS-3ASOCIAL-PROFILE-29-29"></a>

###### [reader](8d80) ‘reblocks-auth/models:profile-metadata‘ (social-profile) (:metadata :params)

<a id="x-28REBLOCKS-AUTH-2FMODELS-3APROFILE-SERVICE-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-AUTH-2FMODELS-3ASOCIAL-PROFILE-29-29"></a>

###### [reader](8673) ‘reblocks-auth/models:profile-service‘ (social-profile) (:service)

<a id="x-28REBLOCKS-AUTH-2FMODELS-3APROFILE-SERVICE-USER-ID-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-AUTH-2FMODELS-3ASOCIAL-PROFILE-29-29"></a>

###### [reader](1119) ‘reblocks-auth/models:profile-service-user-id‘ (social-profile) (:service-user-id)

<a id="x-28REBLOCKS-AUTH-2FMODELS-3APROFILE-USER-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-AUTH-2FMODELS-3ASOCIAL-PROFILE-29-29"></a>

###### [reader] ‘reblocks-auth/models:profile-user‘ (social-profile) (:user)

A [‘user‘][05f7] instance, bound to the [‘social-profile‘][d9d6].

**Accessors**

<a id="x-28REBLOCKS-AUTH-2FMODELS-3APROFILE-METADATA-20-2840ANTS-DOC-2FLOCATIVES-3AACCESSOR-20REBLOCKS-AUTH-2FMODELS-3ASOCIAL-PROFILE-29-29"></a>

###### [accessor](8d80) ‘reblocks-auth/models:profile-metadata‘ (social-profile) (:metadata :params)

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FMODELS-24USER-3FCLASS-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

##### USER

<a id="x-28REBLOCKS-AUTH-2FMODELS-3AUSER-20CLASS-29"></a>

###### [class](96a5) ‘reblocks-auth/models:user‘ (serial-pk-mixin dao-class record-timestamps-mixin)

This class stores basic information about user - it’s nickname and email.
Additional information is stored inside [‘social-profile‘][d9d6] instances.

**Readers**

<a id="x-28REBLOCKS-AUTH-2FMODELS-3AGET-EMAIL-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-AUTH-2FMODELS-3AUSER-29-29"></a>

###### [reader](4133) ‘reblocks-auth/models:get-email‘ (user) (:email = nil)

<a id="x-28REBLOCKS-AUTH-2FMODELS-3AGET-NICKNAME-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-AUTH-2FMODELS-3AUSER-29-29"></a>

###### [reader](4d04) ‘reblocks-auth/models:get-nickname‘ (user) (:nickname)

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FMODELS-3FFunctions-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Functions

<a id="x-28REBLOCKS-AUTH-2FMODELS-3AANONYMOUS-P-20FUNCTION-29"></a>

##### [function](6436) ‘reblocks-auth/models:anonymous-p‘ user

<a id="x-28REBLOCKS-AUTH-2FMODELS-3ACHANGE-EMAIL-20FUNCTION-29"></a>

##### [function](7835) ‘reblocks-auth/models:change-email‘ user email

<a id="x-28REBLOCKS-AUTH-2FMODELS-3ACHANGE-NICKNAME-20FUNCTION-29"></a>

##### [function](9aca) ‘reblocks-auth/models:change-nickname‘ new-nickname

Changes nickname of the current user.

<a id="x-28REBLOCKS-AUTH-2FMODELS-3ACREATE-SOCIAL-USER-20FUNCTION-29"></a>

##### [function](9a92) ‘reblocks-auth/models:create-social-user‘ service service-user-id &rest metadata &key email

<a id="x-28REBLOCKS-AUTH-2FMODELS-3AFIND-SOCIAL-USER-20FUNCTION-29"></a>

##### [function](3bcf) ‘reblocks-auth/models:find-social-user‘ service service-user-id

<a id="x-28REBLOCKS-AUTH-2FMODELS-3AGET-ALL-USERS-20FUNCTION-29"></a>

##### [function](704e) ‘reblocks-auth/models:get-all-users‘

<a id="x-28REBLOCKS-AUTH-2FMODELS-3AGET-CURRENT-USER-20FUNCTION-29"></a>

##### [function](34e6) ‘reblocks-auth/models:get-current-user‘

Returns current user or ‘NIL‘.

<a id="x-28REBLOCKS-AUTH-2FMODELS-3AGET-USER-BY-EMAIL-20FUNCTION-29"></a>

##### [function](2c50) ‘reblocks-auth/models:get-user-by-email‘ email

Returns a user with given email.

<a id="x-28REBLOCKS-AUTH-2FMODELS-3AGET-USER-BY-NICKNAME-20FUNCTION-29"></a>

##### [function](6613) ‘reblocks-auth/models:get-user-by-nickname‘ nickname

Returns a user with given email.

<a id="x-28REBLOCKS-AUTH-2FMODELS-3AUSER-SOCIAL-PROFILES-20FUNCTION-29"></a>

##### [function](c696) ‘reblocks-auth/models:user-social-profiles‘ user

Returns a list of social profiles, bound to the user.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FMODELS-3FVariables-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Variables

<a id="x-28REBLOCKS-AUTH-2FMODELS-3A-2AUSER-CLASS-2A-20-28VARIABLE-29-29"></a>

##### [variable](9936) ‘reblocks-auth/models:*user-class*‘ user

Allows to redefine a model, for users to be created by the reblocks-auth.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMAILGUN-3FPACKAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

### REBLOCKS-AUTH/PROVIDERS/EMAIL/MAILGUN

<a id="x-28-23A-28-2837-29-20BASE-CHAR-20-2E-20-22REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMAILGUN-22-29-20PACKAGE-29"></a>

#### [package](1c21) ‘reblocks-auth/providers/email/mailgun‘

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMAILGUN-3FMacros-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Macros

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMAILGUN-3ADEFINE-CODE-SENDER-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29"></a>

##### [macro](6749) ‘reblocks-auth/providers/email/mailgun:define-code-sender‘ NAME (FROM-EMAIL URL-VAR &KEY (SUBJECT "Authentication code")) &BODY HTML-TEMPLATE-BODY

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-3FPACKAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

### REBLOCKS-AUTH/PROVIDERS/EMAIL/MODELS

<a id="x-28-23A-28-2836-29-20BASE-CHAR-20-2E-20-22REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-22-29-20PACKAGE-29"></a>

#### [package](6c56) ‘reblocks-auth/providers/email/models‘

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-3FClasses-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Classes

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-24REGISTRATION-CODE-3FCLASS-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

##### REGISTRATION-CODE

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-3AREGISTRATION-CODE-20CLASS-29"></a>

###### [class](ab7d) ‘reblocks-auth/providers/email/models:registration-code‘ (serial-pk-mixin dao-class record-timestamps-mixin)

This model stores a code sent to an email for signup or log in.

**Readers**

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-3AREGISTRATION-CODE-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-3AREGISTRATION-CODE-29-29"></a>

###### [reader](9bc4) ‘reblocks-auth/providers/email/models:registration-code‘ (registration-code) (:code)

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-3AREGISTRATION-EMAIL-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-3AREGISTRATION-CODE-29-29"></a>

###### [reader](4c67) ‘reblocks-auth/providers/email/models:registration-email‘ (registration-code) (:email)

User’s email.

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-3AVALID-UNTIL-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-3AREGISTRATION-CODE-29-29"></a>

###### [reader](0303) ‘reblocks-auth/providers/email/models:valid-until‘ (registration-code) (:valid-until)

Expiration time.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-3FFunctions-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Functions

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-3ASEND-CODE-20FUNCTION-29"></a>

##### [function](0874) ‘reblocks-auth/providers/email/models:send-code‘ email &key retpath send-callback

Usually you should define a global callback using
[‘reblocks-auth/providers/email/mailgun:define-code-sender‘][f455] macro,
but you can provide an alternative function to handle
email sending.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-3FVariables-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Variables

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-3A-2ASEND-CODE-CALLBACK-2A-20-28VARIABLE-29-29"></a>

##### [variable](3afd) ‘reblocks-auth/providers/email/models:*send-code-callback*‘ -unbound-

Set this variable to a function of one argument of class [‘registration-code‘][1573].
It should send a registration code using template, suitable for your website.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3FPACKAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

### REBLOCKS-AUTH/PROVIDERS/EMAIL/PROCESSING

<a id="x-28-23A-28-2840-29-20BASE-CHAR-20-2E-20-22REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-22-29-20PACKAGE-29"></a>

#### [package](08fb) ‘reblocks-auth/providers/email/processing‘

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3FClasses-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Classes

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-24REQUEST-CODE-FORM-3FCLASS-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

##### REQUEST-CODE-FORM

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3AREQUEST-CODE-FORM-20CLASS-29"></a>

###### [class](a659) ‘reblocks-auth/providers/email/processing:request-code-form‘ (widget)

**Readers**

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3ARETPATH-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3AREQUEST-CODE-FORM-29-29"></a>

###### [reader](a15a) ‘reblocks-auth/providers/email/processing:retpath‘ (request-code-form) (:retpath)

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3ASENT-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3AREQUEST-CODE-FORM-29-29"></a>

###### [reader](a2e3) ‘reblocks-auth/providers/email/processing:sent‘ (request-code-form) (= nil)

**Accessors**

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3ASENT-20-2840ANTS-DOC-2FLOCATIVES-3AACCESSOR-20REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3AREQUEST-CODE-FORM-29-29"></a>

###### [accessor](a2e3) ‘reblocks-auth/providers/email/processing:sent‘ (request-code-form) (= nil)

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3FGenerics-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Generics

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3AFORM-CSS-CLASSES-20GENERIC-FUNCTION-29"></a>

##### [generic-function](3f68) ‘reblocks-auth/providers/email/processing:form-css-classes‘ widget

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3ARENDER-EMAIL-INPUT-20GENERIC-FUNCTION-29"></a>

##### [generic-function](cfbb) ‘reblocks-auth/providers/email/processing:render-email-input‘ widget

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3ARENDER-SENT-MESSAGE-20GENERIC-FUNCTION-29"></a>

##### [generic-function](30f6) ‘reblocks-auth/providers/email/processing:render-sent-message‘ widget

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3ARENDER-SUBMIT-BUTTON-20GENERIC-FUNCTION-29"></a>

##### [generic-function](951e) ‘reblocks-auth/providers/email/processing:render-submit-button‘ widget

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3FVariables-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Variables

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3A-2ARECAPTCHA-SECRET-KEY-2A-20-28VARIABLE-29-29"></a>

##### [variable](1bb0) ‘reblocks-auth/providers/email/processing:*recaptcha-secret-key*‘ nil

Set this variable to a secret key, generated by Google reCaptcha.

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FPROCESSING-3A-2ARECAPTCHA-SITE-KEY-2A-20-28VARIABLE-29-29"></a>

##### [variable](10f5) ‘reblocks-auth/providers/email/processing:*recaptcha-site-key*‘ nil

Set this variable to a site key, generated by Google reCaptcha.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FRESEND-3FPACKAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

### REBLOCKS-AUTH/PROVIDERS/EMAIL/RESEND

<a id="x-28-23A-28-2836-29-20BASE-CHAR-20-2E-20-22REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FRESEND-22-29-20PACKAGE-29"></a>

#### [package](dfa3) ‘reblocks-auth/providers/email/resend‘

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FRESEND-3FFunctions-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Functions

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FRESEND-3AMAKE-CODE-SENDER-20FUNCTION-29"></a>

##### [function](32d2) ‘reblocks-auth/providers/email/resend:make-code-sender‘ thunk &key base-uri

Makes a function which will prepare params and call ‘THUNK‘ function with email and ‘URL‘.

Usually you don’t need to call this function directly and you can use just [‘define-code-sender‘][fc31] macro.

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FRESEND-3FMacros-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Macros

<a id="x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FRESEND-3ADEFINE-CODE-SENDER-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29"></a>

##### [macro](04c6) ‘reblocks-auth/providers/email/resend:define-code-sender‘ NAME (FROM-EMAIL URL-VAR &KEY (SUBJECT "Authentication code")) &BODY HTML-TEMPLATE-BODY

<a id="x-28REBLOCKS-AUTH-DOCS-2FINDEX-3A-3A-40ROADMAP-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

## Roadmap

* Add support for authentication by a link sent to the email.
* Add ability to bind multiple service providers to a single user.

[e462]: https://40ants.com/reblocks-auth/
[ac3a]: https://40ants.com/reblocks-auth/#x-28-23A-28-2813-29-20BASE-CHAR-20-2E-20-22reblocks-auth-22-29-20ASDF-2FSYSTEM-3ASYSTEM-29
[5d34]: https://40ants.com/reblocks-auth/#x-28REBLOCKS-AUTH-2FBUTTON-3ARENDER-20GENERIC-FUNCTION-29
[ac4c]: https://40ants.com/reblocks-auth/#x-28REBLOCKS-AUTH-2FCORE-3A-2AENABLED-SERVICES-2A-20-28VARIABLE-29-29
[0dc2]: https://40ants.com/reblocks-auth/#x-28REBLOCKS-AUTH-2FCORE-3ALOGIN-PROCESSOR-20CLASS-29
[4d0d]: https://40ants.com/reblocks-auth/#x-28REBLOCKS-AUTH-2FCORE-3ALOGOUT-PROCESSOR-20CLASS-29
[8c78]: https://40ants.com/reblocks-auth/#x-28REBLOCKS-AUTH-2FMODELS-3AGET-CURRENT-USER-20FUNCTION-29
[d9d6]: https://40ants.com/reblocks-auth/#x-28REBLOCKS-AUTH-2FMODELS-3ASOCIAL-PROFILE-20CLASS-29
[05f7]: https://40ants.com/reblocks-auth/#x-28REBLOCKS-AUTH-2FMODELS-3AUSER-20CLASS-29
[f455]: https://40ants.com/reblocks-auth/#x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMAILGUN-3ADEFINE-CODE-SENDER-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29
[1573]: https://40ants.com/reblocks-auth/#x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FMODELS-3AREGISTRATION-CODE-20CLASS-29
[fc31]: https://40ants.com/reblocks-auth/#x-28REBLOCKS-AUTH-2FPROVIDERS-2FEMAIL-2FRESEND-3ADEFINE-CODE-SENDER-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29
[5f0d]: https://40ants.com/reblocks-navigation-widget/#x-28REBLOCKS-NAVIGATION-WIDGET-3ADEFROUTES-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29
[1668]: https://github.com/40ants/reblocks-auth
[2ba2]: https://github.com/40ants/reblocks-auth/actions
[7bb8]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/auth.lisp#L1
[0067]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/auth.lisp#L8
[c6c8]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/button.lisp#L1
[2b0e]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/button.lisp#L10
[957c]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/conditions.lisp#L1
[da77]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/conditions.lisp#L10
[8c4b]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/core.lisp#L1
[a47a]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/core.lisp#L143
[09e2]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/core.lisp#L43
[c9c9]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/core.lisp#L47
[52c4]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/core.lisp#L51
[0603]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/core.lisp#L55
[811c]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/core.lisp#L60
[7208]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/core.lisp#L65
[9d8c]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/core.lisp#L69
[d46d]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/core.lisp#L80
[09d9]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/errors.lisp#L1
[163d]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/errors.lisp#L7
[b908]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/github.lisp#L1
[8cc0]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/github.lisp#L144
[e341]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/github.lisp#L149
[2dd0]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/github.lisp#L36
[1344]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/github.lisp#L40
[dea4]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/github.lisp#L44
[2c83]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/github.lisp#L82
[f4b8]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L1
[704e]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L106
[3bcf]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L110
[9a92]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L119
[34e6]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L146
[c696]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L152
[6436]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L165
[2c50]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L169
[6613]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L174
[9aca]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L179
[7835]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L193
[96a5]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L37
[4d04]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L38
[4133]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L44
[9936]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L55
[8a32]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L59
[8673]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L68
[1119]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L74
[8d80]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/models.lisp#L77
[1c21]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/mailgun.lisp#L1
[6749]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/mailgun.lisp#L44
[6c56]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/models.lisp#L1
[3afd]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/models.lisp#L21
[ab7d]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/models.lisp#L43
[4c67]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/models.lisp#L44
[9bc4]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/models.lisp#L48
[0303]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/models.lisp#L52
[0874]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/models.lisp#L78
[08fb]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/processing.lisp#L1
[30f6]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/processing.lisp#L157
[cfbb]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/processing.lisp#L173
[951e]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/processing.lisp#L181
[3f68]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/processing.lisp#L189
[10f5]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/processing.lisp#L42
[1bb0]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/processing.lisp#L45
[a659]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/processing.lisp#L49
[a15a]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/processing.lisp#L50
[a2e3]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/processing.lisp#L52
[dfa3]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/resend.lisp#L1
[32d2]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/resend.lisp#L16
[04c6]: https://github.com/40ants/reblocks-auth/blob/8f371016e7c289fd2d78a7a2b530c8370e15575b/src/providers/email/resend.lisp#L44
[4f85]: https://github.com/40ants/reblocks-auth/issues
[c7c4]: https://github.com/fukamachi/mito
[8236]: https://quickdocs.org/alexandria
[2ecb]: https://quickdocs.org/cl-strings
[8347]: https://quickdocs.org/dexador
[6dd8]: https://quickdocs.org/jonathan
[46a1]: https://quickdocs.org/local-time
[7f8b]: https://quickdocs.org/log4cl
[ef16]: https://quickdocs.org/mailgun
[5b70]: https://quickdocs.org/mito
[2103]: https://quickdocs.org/quri
[184b]: https://quickdocs.org/reblocks
[28e0]: https://quickdocs.org/reblocks-lass
[4376]: https://quickdocs.org/reblocks-ui
[cd18]: https://quickdocs.org/secret-values
[c41d]: https://quickdocs.org/serapeum
[d6b3]: https://quickdocs.org/uuid
[aba2]: https://quickdocs.org/yason

* * *
###### [generated by [40ANTS-DOC](https://40ants.com/doc/)]

Version

0.11.0

Defsystem Dependency

40ants-asdf-system (system).

Dependencies
Source

reblocks-auth.asd.


2.2 reblocks-auth/core

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-auth/

Source Control

(GIT https://github.com/40ants/reblocks-auth)

Bug Tracker

https://github.com/40ants/reblocks-auth/issues

License

Unlicense

Dependencies
Source

reblocks-auth.asd.


2.3 reblocks-auth/button

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-auth/

Source Control

(GIT https://github.com/40ants/reblocks-auth)

Bug Tracker

https://github.com/40ants/reblocks-auth/issues

License

Unlicense

Dependency

reblocks/html (system).

Source

reblocks-auth.asd.


2.4 reblocks-auth/auth

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-auth/

Source Control

(GIT https://github.com/40ants/reblocks-auth)

Bug Tracker

https://github.com/40ants/reblocks-auth/issues

License

Unlicense

Source

reblocks-auth.asd.


2.5 reblocks-auth/utils

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-auth/

Source Control

(GIT https://github.com/40ants/reblocks-auth)

Bug Tracker

https://github.com/40ants/reblocks-auth/issues

License

Unlicense

Dependency

alexandria (system).

Source

reblocks-auth.asd.


2.6 reblocks-auth/conditions

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-auth/

Source Control

(GIT https://github.com/40ants/reblocks-auth)

Bug Tracker

https://github.com/40ants/reblocks-auth/issues

License

Unlicense

Source

reblocks-auth.asd.


2.7 reblocks-auth/models

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-auth/

Source Control

(GIT https://github.com/40ants/reblocks-auth)

Bug Tracker

https://github.com/40ants/reblocks-auth/issues

License

Unlicense

Dependencies
  • jonathan (system).
  • reblocks/session (system).
  • alexandria (system).
  • mito (system).
  • reblocks-auth/errors (system).
Source

reblocks-auth.asd.


2.8 reblocks-auth/errors

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-auth/

Source Control

(GIT https://github.com/40ants/reblocks-auth)

Bug Tracker

https://github.com/40ants/reblocks-auth/issues

License

Unlicense

Source

reblocks-auth.asd.


2.9 reblocks-auth/github

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-auth/

Source Control

(GIT https://github.com/40ants/reblocks-auth)

Bug Tracker

https://github.com/40ants/reblocks-auth/issues

License

Unlicense

Dependencies
Source

reblocks-auth.asd.


2.10 reblocks-auth/providers/email/processing

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-auth/

Source Control

(GIT https://github.com/40ants/reblocks-auth)

Bug Tracker

https://github.com/40ants/reblocks-auth/issues

License

Unlicense

Dependencies
Source

reblocks-auth.asd.


2.11 reblocks-auth/providers/email/models

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-auth/

Source Control

(GIT https://github.com/40ants/reblocks-auth)

Bug Tracker

https://github.com/40ants/reblocks-auth/issues

License

Unlicense

Dependencies
  • log4cl (system).
  • local-time (system).
  • uuid (system).
  • mito (system).
Source

reblocks-auth.asd.


2.12 reblocks-auth/providers/email/mailgun

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-auth/

Source Control

(GIT https://github.com/40ants/reblocks-auth)

Bug Tracker

https://github.com/40ants/reblocks-auth/issues

License

Unlicense

Dependencies
Source

reblocks-auth.asd.


3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.2 reblocks-auth/core/file-type.lisp

Source

reblocks-auth.asd.

Parent Component

reblocks-auth/core (system).

Packages

reblocks-auth/core.

Public Interface
Internals

reach-goal (generic function).


3.1.3 reblocks-auth/button/file-type.lisp

Source

reblocks-auth.asd.

Parent Component

reblocks-auth/button (system).

Packages

reblocks-auth/button.

Public Interface

render (generic function).


3.1.4 reblocks-auth/auth/file-type.lisp

Source

reblocks-auth.asd.

Parent Component

reblocks-auth/auth (system).

Packages

reblocks-auth/auth.

Public Interface

authenticate (generic function).


3.1.5 reblocks-auth/utils/file-type.lisp

Source

reblocks-auth.asd.

Parent Component

reblocks-auth/utils (system).

Packages

reblocks-auth/utils.

Internals

3.1.6 reblocks-auth/conditions/file-type.lisp

Source

reblocks-auth.asd.

Parent Component

reblocks-auth/conditions (system).

Packages

reblocks-auth/conditions.

Public Interface

3.1.7 reblocks-auth/models/file-type.lisp

Source

reblocks-auth.asd.

Parent Component

reblocks-auth/models (system).

Packages

reblocks-auth/models.

Public Interface

3.1.8 reblocks-auth/errors/file-type.lisp

Source

reblocks-auth.asd.

Parent Component

reblocks-auth/errors (system).

Packages

reblocks-auth/errors.

Public Interface

nickname-is-not-available (condition).


3.1.9 reblocks-auth/github/file-type.lisp

Source

reblocks-auth.asd.

Parent Component

reblocks-auth/github (system).

Packages

reblocks-auth/github.

Public Interface
Internals

3.1.10 reblocks-auth/providers/email/processing/file-type.lisp

Source

reblocks-auth.asd.

Parent Component

reblocks-auth/providers/email/processing (system).

Packages

reblocks-auth/providers/email/processing.

Public Interface
Internals

3.1.11 reblocks-auth/providers/email/models/file-type.lisp

Source

reblocks-auth.asd.

Parent Component

reblocks-auth/providers/email/models (system).

Packages

reblocks-auth/providers/email/models.

Public Interface
Internals

3.1.12 reblocks-auth/providers/email/mailgun/file-type.lisp

Source

reblocks-auth.asd.

Parent Component

reblocks-auth/providers/email/mailgun (system).

Packages

reblocks-auth/providers/email/mailgun.

Public Interface

define-code-sender (macro).

Internals

make-code-sender (function).


4 Packages

Packages are listed by definition order.


4.1 reblocks-auth/providers/email/processing

Source

file-type.lisp.

Use List

common-lisp.

Public Interface
Internals

4.2 reblocks-auth/conditions

Source

file-type.lisp.

Use List

common-lisp.

Public Interface

4.3 reblocks-auth/models

Source

file-type.lisp.

Use List

common-lisp.

Public Interface

4.4 reblocks-auth/button

Source

file-type.lisp.

Use List

common-lisp.

Public Interface

render (generic function).


4.5 reblocks-auth/providers/email/mailgun

Source

file-type.lisp.

Use List

common-lisp.

Public Interface

define-code-sender (macro).

Internals

make-code-sender (function).


4.6 reblocks-auth/auth

Source

file-type.lisp.

Use List

common-lisp.

Public Interface

authenticate (generic function).


4.7 reblocks-auth/github

Source

file-type.lisp.

Use List

common-lisp.

Public Interface
Internals

4.8 reblocks-auth/errors

Source

file-type.lisp.

Use List

common-lisp.

Public Interface

nickname-is-not-available (condition).


4.9 reblocks-auth/utils

Source

file-type.lisp.

Use List

common-lisp.

Internals

4.10 reblocks-auth/providers/email/models

Source

file-type.lisp.

Use List

common-lisp.

Public Interface
Internals

4.11 reblocks-auth/core

Source

file-type.lisp.

Nickname

reblocks-auth

Use List

common-lisp.

Public Interface
Internals

reach-goal (generic function).


5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Special variables

Special Variable: *allow-new-accounts-creation*

When True, a new account will be created. Otherwise only already existing users can log in.

Package

reblocks-auth/core.

Source

file-type.lisp.

Special Variable: *client-id*

OAuth client id

Package

reblocks-auth/github.

Source

file-type.lisp.

Special Variable: *default-scopes*

A listo of default scopes to request from GitHub.

Package

reblocks-auth/github.

Source

file-type.lisp.

Special Variable: *enabled-services*

Set this variable to limit a services available to login through.

Package

reblocks-auth/core.

Source

file-type.lisp.

Special Variable: *login-hooks*

Append a funcallable handlers which accept single argument - logged user.

Package

reblocks-auth/core.

Source

file-type.lisp.

Special Variable: *recaptcha-secret-key*

Set this variable to a secret key, generated by Google reCaptcha.

Package

reblocks-auth/providers/email/processing.

Source

file-type.lisp.

Special Variable: *recaptcha-site-key*

Set this variable to a site key, generated by Google reCaptcha.

Package

reblocks-auth/providers/email/processing.

Source

file-type.lisp.

Special Variable: *secret*

OAuth secret. It might be a string or secret-values:secret-value.

Package

reblocks-auth/github.

Source

file-type.lisp.

Special Variable: *send-code-callback*

Set this variable to a function of one argument of class REGISTRATION-CODE. It should send a registration code using template, suitable for your website.

Package

reblocks-auth/providers/email/models.

Source

file-type.lisp.

Special Variable: *user-class*

Allows to redefine a model, for users to be created by the reblocks-auth.

Package

reblocks-auth/models.

Source

file-type.lisp.


5.1.2 Macros

Macro: define-code-sender (name (from-email url-var &key subject) &body html-template-body)
Package

reblocks-auth/providers/email/mailgun.

Source

file-type.lisp.


5.1.3 Ordinary functions

Function: anonymous-p (user)
Package

reblocks-auth/models.

Source

file-type.lisp.

Function: change-email (user email)
Package

reblocks-auth/models.

Source

file-type.lisp.

Function: change-nickname (new-nickname)

Changes nickname of the current user.

Package

reblocks-auth/models.

Source

file-type.lisp.

Function: create-social-user (service service-user-id &rest metadata &key email)
Package

reblocks-auth/models.

Source

file-type.lisp.

Function: find-social-user (service service-user-id)
Package

reblocks-auth/models.

Source

file-type.lisp.

Function: get-all-users ()
Package

reblocks-auth/models.

Source

file-type.lisp.

Function: get-current-user ()

Returns current user or NIL.

Package

reblocks-auth/models.

Source

file-type.lisp.

Function: (setf get-current-user) ()
Package

reblocks-auth/models.

Source

file-type.lisp.

Function: get-scopes ()

Returns current user’s scopes.

Package

reblocks-auth/github.

Source

file-type.lisp.

Function: get-token ()

Returns current user’s GitHub token.

Package

reblocks-auth/github.

Source

file-type.lisp.

Function: get-user-by-email (email)

Returns a user with given email.

Package

reblocks-auth/models.

Source

file-type.lisp.

Function: get-user-by-nickname (nickname)

Returns a user with given email.

Package

reblocks-auth/models.

Source

file-type.lisp.

Function: make-login-processor ()
Package

reblocks-auth/core.

Source

file-type.lisp.

Function: make-logout-processor ()
Package

reblocks-auth/core.

Source

file-type.lisp.

Function: render-button (&key class scopes text retpath)

Renders a button to request more scopes.

Package

reblocks-auth/github.

Source

file-type.lisp.

Function: render-buttons (&key retpath)

Renders a row of buttons for enabled service providers.

Optionally you can specify RETPATH argument with an URI to return user after login.

Package

reblocks-auth/core.

Source

file-type.lisp.

Function: send-code (email &key retpath send-callback)

Usually you should define a global callback using REBLOCKS-AUTH/PROVIDERS/EMAIL/MAILGUN:DEFINE-CODE-SENDER macro, but you can provide an alternative function to handle
email sending.

Package

reblocks-auth/providers/email/models.

Source

file-type.lisp.

Function: user-social-profiles (user)

Returns a list of social profiles, bound to the user.

Package

reblocks-auth/models.

Source

file-type.lisp.


5.1.4 Generic functions

Generic Function: authenticate (service &rest params &key code)

Called when user had authenticated in the service and returned
to our site.

All GET arguments are collected into a plist and passed as params.

Should return two values a user and a flag denotifing if user was just created.

Package

reblocks-auth/auth.

Source

file-type.lisp.

Methods
Method: authenticate ((service (eql :email)) &rest params &key code)
Source

file-type.lisp.

Method: authenticate ((service (eql :github)) &rest params &key code)
Source

file-type.lisp.

Method: authenticate (service &rest params)
Generic Function: form-css-classes (widget)
Package

reblocks-auth/providers/email/processing.

Source

file-type.lisp.

Methods
Method: form-css-classes ((widget request-code-form))
Generic Reader: get-email (object)
Package

reblocks-auth/models.

Methods
Reader Method: get-email ((user user))

automatically generated reader method

Source

file-type.lisp.

Target Slot

email.

Generic Reader: get-message (condition)
Package

reblocks-auth/conditions.

Methods
Reader Method: get-message ((condition unable-to-authenticate))
Source

file-type.lisp.

Target Slot

message.

Generic Reader: get-nickname (object)
Package

reblocks-auth/models.

Methods
Reader Method: get-nickname ((user user))

automatically generated reader method

Source

file-type.lisp.

Target Slot

nickname.

Generic Reader: get-reason (condition)
Package

reblocks-auth/conditions.

Methods
Reader Method: get-reason ((condition unable-to-authenticate))
Source

file-type.lisp.

Target Slot

reason.

Generic Reader: profile-metadata (object)
Package

reblocks-auth/models.

Methods
Reader Method: profile-metadata ((social-profile social-profile))

automatically generated reader method

Source

file-type.lisp.

Target Slot

metadata.

Generic Writer: (setf profile-metadata) (object)
Package

reblocks-auth/models.

Methods
Writer Method: (setf profile-metadata) ((social-profile social-profile))

automatically generated writer method

Source

file-type.lisp.

Target Slot

metadata.

Generic Reader: profile-service (object)
Package

reblocks-auth/models.

Methods
Reader Method: profile-service ((social-profile social-profile))

automatically generated reader method

Source

file-type.lisp.

Target Slot

service.

Generic Reader: profile-service-user-id (object)
Package

reblocks-auth/models.

Methods
Reader Method: profile-service-user-id ((social-profile social-profile))

automatically generated reader method

Source

file-type.lisp.

Target Slot

service-user-id.

Generic Reader: profile-user (object)
Package

reblocks-auth/models.

Methods
Reader Method: profile-user ((object social-profile))
Target Slot

user.

Generic Reader: registration-code (object)
Package

reblocks-auth/providers/email/models.

Methods
Reader Method: registration-code ((registration-code registration-code))

automatically generated reader method

Source

file-type.lisp.

Target Slot

code.

Generic Reader: registration-email (object)
Package

reblocks-auth/providers/email/models.

Methods
Reader Method: registration-email ((registration-code registration-code))

User’s email.

Source

file-type.lisp.

Target Slot

email.

Generic Function: render (service &key retpath)

Renders a button for given service.
Service should be a keyword like :github or :facebook.

Package

reblocks-auth/button.

Source

file-type.lisp.

Methods
Method: render ((service (eql :email)) &key retpath)
Source

file-type.lisp.

Method: render ((service (eql :github)) &key retpath)
Source

file-type.lisp.

Method: render (service &key retpath)
Generic Function: render-email-input (widget)
Package

reblocks-auth/providers/email/processing.

Source

file-type.lisp.

Methods
Method: render-email-input ((widget request-code-form))
Generic Function: render-login-page (app &key retpath)

By default, renders a list of buttons for each allowed authentication method.

Package

reblocks-auth/core.

Source

file-type.lisp.

Methods
Method: render-login-page (app &key retpath)
Generic Function: render-sent-message (widget)
Package

reblocks-auth/providers/email/processing.

Source

file-type.lisp.

Methods
Method: render-sent-message ((widget request-code-form))
Method: render-sent-message ((widget request-code-form-for-popup))
Generic Function: render-submit-button (widget)
Package

reblocks-auth/providers/email/processing.

Source

file-type.lisp.

Methods
Method: render-submit-button ((widget request-code-form))
Generic Reader: retpath (object)
Package

reblocks-auth/providers/email/processing.

Methods
Reader Method: retpath ((request-code-form request-code-form))

automatically generated reader method

Source

file-type.lisp.

Target Slot

retpath.

Generic Reader: sent (object)
Package

reblocks-auth/providers/email/processing.

Methods
Reader Method: sent ((request-code-form request-code-form))

automatically generated reader method

Source

file-type.lisp.

Target Slot

sent.

Generic Writer: (setf sent) (object)
Package

reblocks-auth/providers/email/processing.

Methods
Writer Method: (setf sent) ((request-code-form request-code-form))

automatically generated writer method

Source

file-type.lisp.

Target Slot

sent.

Generic Reader: valid-until (object)
Package

reblocks-auth/providers/email/models.

Methods
Reader Method: valid-until ((registration-code registration-code))

Expiration time.

Source

file-type.lisp.

Target Slot

valid-until.


5.1.5 Standalone methods

Method: get-dependencies ((widget request-code-popup))
Package

reblocks/dependencies.

Source

file-type.lisp.

Method: get-dependencies ((widget login-processor))
Package

reblocks/dependencies.

Source

file-type.lisp.

Method: print-object ((obj user) stream)
Source

file-type.lisp.

Method: print-object ((obj social-profile) stream)
Source

file-type.lisp.

Method: print-object ((obj registration-code) stream)
Source

file-type.lisp.

Method: render ((widget request-code-form))
Package

reblocks/widget.

Source

file-type.lisp.

Method: render ((widget logout-processor))
Package

reblocks/widget.

Source

file-type.lisp.

Method: render ((widget login-processor))
Package

reblocks/widget.

Source

file-type.lisp.

Method: render-popup-content ((widget request-code-popup))
Package

reblocks-ui/popup.

Source

file-type.lisp.


5.1.6 Conditions

Condition: nickname-is-not-available

Signalled when there is already a user with given nickname.

Package

reblocks-auth/errors.

Source

file-type.lisp.

Direct superclasses

error.

Condition: unable-to-authenticate
Package

reblocks-auth/conditions.

Source

file-type.lisp.

Direct superclasses

condition.

Direct methods
Direct slots
Slot: message
Initargs

:message

Readers

get-message.

Writers

This slot is read-only.

Slot: reason
Initform

(quote nil)

Initargs

:reason

Readers

get-reason.

Writers

This slot is read-only.


5.1.7 Classes

Class: login-processor

This widget should be rendered to process user’s login.

Package

reblocks-auth/core.

Source

file-type.lisp.

Direct superclasses

widget.

Direct methods
Class: logout-processor

This widget should be rendered to process user’s logout.

Package

reblocks-auth/core.

Source

file-type.lisp.

Direct superclasses

widget.

Direct methods

render.

Class: registration-code

This model stores a code sent to an email for signup or log in.

Package

reblocks-auth/providers/email/models.

Source

file-type.lisp.

Direct superclasses
  • dao-class.
  • record-timestamps-mixin.
  • serial-pk-mixin.
Direct methods
Direct slots
Slot: email

User’s email.

Initargs

:email

Readers

registration-email.

Writers

This slot is read-only.

Slot: code
Initargs

:code

Readers

registration-code.

Writers

This slot is read-only.

Slot: valid-until

Expiration time.

Initargs

:valid-until

Readers

valid-until.

Writers

This slot is read-only.

Class: request-code-form
Package

reblocks-auth/providers/email/processing.

Source

file-type.lisp.

Direct superclasses

widget.

Direct subclasses

request-code-form-for-popup.

Direct methods
Direct slots
Slot: retpath
Initargs

:retpath

Readers

retpath.

Writers

This slot is read-only.

Slot: sent
Readers

sent.

Writers

(setf sent).

Class: social-profile

Represents a User’s link to a social service.
User can be bound to multiple social services.

Package

reblocks-auth/models.

Source

file-type.lisp.

Direct superclasses
  • dao-class.
  • record-timestamps-mixin.
  • serial-pk-mixin.
Direct methods
Direct slots
Slot: user

A USER instance, bound to the SOCIAL-PROFILE.

Initargs

:user

Readers

profile-user.

Writers

This slot is read-only.

Slot: user-id
Initargs

:user-id

Slot: service
Initargs

:service

Readers

profile-service.

Writers

This slot is read-only.

Slot: service-user-id
Initargs

:service-user-id

Readers

profile-service-user-id.

Writers

This slot is read-only.

Slot: metadata
Initargs

:metadata, :params

Readers

profile-metadata.

Writers

(setf profile-metadata).

Class: user

This class stores basic information about user - it’s nickname and email. Additional information is stored inside SOCIAL-PROFILE instances.

Package

reblocks-auth/models.

Source

file-type.lisp.

Direct superclasses
  • dao-class.
  • record-timestamps-mixin.
  • serial-pk-mixin.
Direct methods
Direct slots
Slot: nickname
Initargs

:nickname

Readers

get-nickname.

Writers

This slot is read-only.

Slot: email
Initargs

:email

Readers

get-email.

Writers

This slot is read-only.


5.2 Internals


5.2.1 Special variables

Special Variable: *code-ttl*

Time to live for authentication code.

Package

reblocks-auth/providers/email/models.

Source

file-type.lisp.


5.2.2 Ordinary functions

Function: check-registration-code (code)

Authenticates a user.

If code wasn’t found, then condition code-unknown will be raised. If code is expired, then condition code-expired will be raised.

Возвращает пользователя, а вторым значением t если пользователь уже был и nil если это новая учётка.

Package

reblocks-auth/providers/email/models.

Source

file-type.lisp.

Function: get-oauth-token-by (code)
Package

reblocks-auth/github.

Source

file-type.lisp.

Function: keywordify (string)
Package

reblocks-auth/utils.

Source

file-type.lisp.

Function: make-authentication-url (&key scopes redirect-uri)
Package

reblocks-auth/github.

Source

file-type.lisp.

Function: make-code-sender (thunk)
Package

reblocks-auth/providers/email/mailgun.

Source

file-type.lisp.

Function: make-default-redirect-uri ()
Package

reblocks-auth/github.

Source

file-type.lisp.

Function: make-registration-code (email &key ttl)
Package

reblocks-auth/providers/email/models.

Source

file-type.lisp.

Function: to-plist (alist &key without)
Package

reblocks-auth/utils.

Source

file-type.lisp.

Function: verify-recaptcha (token)

More about token verification:

https://developers.google.com/recaptcha/docs/verify

Package

reblocks-auth/providers/email/processing.

Source

file-type.lisp.


5.2.3 Generic functions

Generic Reader: form (object)
Package

reblocks-auth/providers/email/processing.

Methods
Reader Method: form ((request-code-popup request-code-popup))

automatically generated reader method

Source

file-type.lisp.

Target Slot

form.

Generic Reader: get-code (condition)
Package

reblocks-auth/providers/email/models.

Methods
Reader Method: get-code ((condition code-expired))
Source

file-type.lisp.

Target Slot

code.

Reader Method: get-code ((condition code-unknown))
Source

file-type.lisp.

Target Slot

code.

Generic Function: reach-goal (widget goal-name &key survive-redirect-p)
Package

reblocks-auth/core.

Source

file-type.lisp.

Methods
Method: reach-goal (widget goal-name &key survive-redirect-p)

5.2.4 Conditions

Condition: code-expired

Signalled when code was found but already expired.

Package

reblocks-auth/providers/email/models.

Source

file-type.lisp.

Direct superclasses

error.

Direct methods

get-code.

Direct slots
Slot: code
Initargs

:code

Readers

get-code.

Writers

This slot is read-only.

Condition: code-unknown

Signalled when code was not found in the database.

Package

reblocks-auth/providers/email/models.

Source

file-type.lisp.

Direct superclasses

error.

Direct methods

get-code.

Direct slots
Slot: code
Initargs

:code

Readers

get-code.

Writers

This slot is read-only.

Condition: new-accounts-are-prohibited
Package

reblocks-auth/providers/email/processing.

Source

file-type.lisp.

Direct superclasses

error.


5.2.5 Classes

Class: request-code-form-for-popup
Package

reblocks-auth/providers/email/processing.

Source

file-type.lisp.

Direct superclasses

request-code-form.

Direct methods

render-sent-message.

Class: request-code-popup
Package

reblocks-auth/providers/email/processing.

Source

file-type.lisp.

Direct superclasses

popup-widget.

Direct methods
Direct slots
Slot: form
Type

reblocks-auth/providers/email/processing::request-code-form-for-popup

Initargs

:form

Readers

form.

Writers

This slot is read-only.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   D   F   G   K   M   P   R   S   T   U   V  
Index Entry  Section

(
(setf get-current-user): Public ordinary functions
(setf profile-metadata): Public generic functions
(setf profile-metadata): Public generic functions
(setf sent): Public generic functions
(setf sent): Public generic functions

A
anonymous-p: Public ordinary functions
authenticate: Public generic functions
authenticate: Public generic functions
authenticate: Public generic functions
authenticate: Public generic functions

C
change-email: Public ordinary functions
change-nickname: Public ordinary functions
check-registration-code: Private ordinary functions
create-social-user: Public ordinary functions

D
define-code-sender: Public macros

F
find-social-user: Public ordinary functions
form: Private generic functions
form: Private generic functions
form-css-classes: Public generic functions
form-css-classes: Public generic functions
Function, (setf get-current-user): Public ordinary functions
Function, anonymous-p: Public ordinary functions
Function, change-email: Public ordinary functions
Function, change-nickname: Public ordinary functions
Function, check-registration-code: Private ordinary functions
Function, create-social-user: Public ordinary functions
Function, find-social-user: Public ordinary functions
Function, get-all-users: Public ordinary functions
Function, get-current-user: Public ordinary functions
Function, get-oauth-token-by: Private ordinary functions
Function, get-scopes: Public ordinary functions
Function, get-token: Public ordinary functions
Function, get-user-by-email: Public ordinary functions
Function, get-user-by-nickname: Public ordinary functions
Function, keywordify: Private ordinary functions
Function, make-authentication-url: Private ordinary functions
Function, make-code-sender: Private ordinary functions
Function, make-default-redirect-uri: Private ordinary functions
Function, make-login-processor: Public ordinary functions
Function, make-logout-processor: Public ordinary functions
Function, make-registration-code: Private ordinary functions
Function, render-button: Public ordinary functions
Function, render-buttons: Public ordinary functions
Function, send-code: Public ordinary functions
Function, to-plist: Private ordinary functions
Function, user-social-profiles: Public ordinary functions
Function, verify-recaptcha: Private ordinary functions

G
Generic Function, (setf profile-metadata): Public generic functions
Generic Function, (setf sent): Public generic functions
Generic Function, authenticate: Public generic functions
Generic Function, form: Private generic functions
Generic Function, form-css-classes: Public generic functions
Generic Function, get-code: Private generic functions
Generic Function, get-email: Public generic functions
Generic Function, get-message: Public generic functions
Generic Function, get-nickname: Public generic functions
Generic Function, get-reason: Public generic functions
Generic Function, profile-metadata: Public generic functions
Generic Function, profile-service: Public generic functions
Generic Function, profile-service-user-id: Public generic functions
Generic Function, profile-user: Public generic functions
Generic Function, reach-goal: Private generic functions
Generic Function, registration-code: Public generic functions
Generic Function, registration-email: Public generic functions
Generic Function, render: Public generic functions
Generic Function, render-email-input: Public generic functions
Generic Function, render-login-page: Public generic functions
Generic Function, render-sent-message: Public generic functions
Generic Function, render-submit-button: Public generic functions
Generic Function, retpath: Public generic functions
Generic Function, sent: Public generic functions
Generic Function, valid-until: Public generic functions
get-all-users: Public ordinary functions
get-code: Private generic functions
get-code: Private generic functions
get-code: Private generic functions
get-current-user: Public ordinary functions
get-dependencies: Public standalone methods
get-dependencies: Public standalone methods
get-email: Public generic functions
get-email: Public generic functions
get-message: Public generic functions
get-message: Public generic functions
get-nickname: Public generic functions
get-nickname: Public generic functions
get-oauth-token-by: Private ordinary functions
get-reason: Public generic functions
get-reason: Public generic functions
get-scopes: Public ordinary functions
get-token: Public ordinary functions
get-user-by-email: Public ordinary functions
get-user-by-nickname: Public ordinary functions

K
keywordify: Private ordinary functions

M
Macro, define-code-sender: Public macros
make-authentication-url: Private ordinary functions
make-code-sender: Private ordinary functions
make-default-redirect-uri: Private ordinary functions
make-login-processor: Public ordinary functions
make-logout-processor: Public ordinary functions
make-registration-code: Private ordinary functions
Method, (setf profile-metadata): Public generic functions
Method, (setf sent): Public generic functions
Method, authenticate: Public generic functions
Method, authenticate: Public generic functions
Method, authenticate: Public generic functions
Method, form: Private generic functions
Method, form-css-classes: Public generic functions
Method, get-code: Private generic functions
Method, get-code: Private generic functions
Method, get-dependencies: Public standalone methods
Method, get-dependencies: Public standalone methods
Method, get-email: Public generic functions
Method, get-message: Public generic functions
Method, get-nickname: Public generic functions
Method, get-reason: Public generic functions
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, profile-metadata: Public generic functions
Method, profile-service: Public generic functions
Method, profile-service-user-id: Public generic functions
Method, profile-user: Public generic functions
Method, reach-goal: Private generic functions
Method, registration-code: Public generic functions
Method, registration-email: Public generic functions
Method, render: Public generic functions
Method, render: Public generic functions
Method, render: Public generic functions
Method, render: Public standalone methods
Method, render: Public standalone methods
Method, render: Public standalone methods
Method, render-email-input: Public generic functions
Method, render-login-page: Public generic functions
Method, render-popup-content: Public standalone methods
Method, render-sent-message: Public generic functions
Method, render-sent-message: Public generic functions
Method, render-submit-button: Public generic functions
Method, retpath: Public generic functions
Method, sent: Public generic functions
Method, valid-until: Public generic functions

P
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
profile-metadata: Public generic functions
profile-metadata: Public generic functions
profile-service: Public generic functions
profile-service: Public generic functions
profile-service-user-id: Public generic functions
profile-service-user-id: Public generic functions
profile-user: Public generic functions
profile-user: Public generic functions

R
reach-goal: Private generic functions
reach-goal: Private generic functions
registration-code: Public generic functions
registration-code: Public generic functions
registration-email: Public generic functions
registration-email: Public generic functions
render: Public generic functions
render: Public generic functions
render: Public generic functions
render: Public generic functions
render: Public standalone methods
render: Public standalone methods
render: Public standalone methods
render-button: Public ordinary functions
render-buttons: Public ordinary functions
render-email-input: Public generic functions
render-email-input: Public generic functions
render-login-page: Public generic functions
render-login-page: Public generic functions
render-popup-content: Public standalone methods
render-sent-message: Public generic functions
render-sent-message: Public generic functions
render-sent-message: Public generic functions
render-submit-button: Public generic functions
render-submit-button: Public generic functions
retpath: Public generic functions
retpath: Public generic functions

S
send-code: Public ordinary functions
sent: Public generic functions
sent: Public generic functions

T
to-plist: Private ordinary functions

U
user-social-profiles: Public ordinary functions

V
valid-until: Public generic functions
valid-until: Public generic functions
verify-recaptcha: Private ordinary functions


A.3 Variables

Jump to:   *  
C   E   F   M   N   R   S   U   V  
Index Entry  Section

*
*allow-new-accounts-creation*: Public special variables
*client-id*: Public special variables
*code-ttl*: Private special variables
*default-scopes*: Public special variables
*enabled-services*: Public special variables
*login-hooks*: Public special variables
*recaptcha-secret-key*: Public special variables
*recaptcha-site-key*: Public special variables
*secret*: Public special variables
*send-code-callback*: Public special variables
*user-class*: Public special variables

C
code: Public classes
code: Private conditions
code: Private conditions

E
email: Public classes
email: Public classes

F
form: Private classes

M
message: Public conditions
metadata: Public classes

N
nickname: Public classes

R
reason: Public conditions
retpath: Public classes

S
sent: Public classes
service: Public classes
service-user-id: Public classes
Slot, code: Public classes
Slot, code: Private conditions
Slot, code: Private conditions
Slot, email: Public classes
Slot, email: Public classes
Slot, form: Private classes
Slot, message: Public conditions
Slot, metadata: Public classes
Slot, nickname: Public classes
Slot, reason: Public conditions
Slot, retpath: Public classes
Slot, sent: Public classes
Slot, service: Public classes
Slot, service-user-id: Public classes
Slot, user: Public classes
Slot, user-id: Public classes
Slot, valid-until: Public classes
Special Variable, *allow-new-accounts-creation*: Public special variables
Special Variable, *client-id*: Public special variables
Special Variable, *code-ttl*: Private special variables
Special Variable, *default-scopes*: Public special variables
Special Variable, *enabled-services*: Public special variables
Special Variable, *login-hooks*: Public special variables
Special Variable, *recaptcha-secret-key*: Public special variables
Special Variable, *recaptcha-site-key*: Public special variables
Special Variable, *secret*: Public special variables
Special Variable, *send-code-callback*: Public special variables
Special Variable, *user-class*: Public special variables

U
user: Public classes
user-id: Public classes

V
valid-until: Public classes


A.4 Data types

Jump to:   C   F   L   N   P   R   S   U  
Index Entry  Section

C
Class, login-processor: Public classes
Class, logout-processor: Public classes
Class, registration-code: Public classes
Class, request-code-form: Public classes
Class, request-code-form-for-popup: Private classes
Class, request-code-popup: Private classes
Class, social-profile: Public classes
Class, user: Public classes
code-expired: Private conditions
code-unknown: Private conditions
Condition, code-expired: Private conditions
Condition, code-unknown: Private conditions
Condition, new-accounts-are-prohibited: Private conditions
Condition, nickname-is-not-available: Public conditions
Condition, unable-to-authenticate: Public conditions

F
File, file-type.lisp: The reblocks-auth/core/file-type․lisp file
File, file-type.lisp: The reblocks-auth/button/file-type․lisp file
File, file-type.lisp: The reblocks-auth/auth/file-type․lisp file
File, file-type.lisp: The reblocks-auth/utils/file-type․lisp file
File, file-type.lisp: The reblocks-auth/conditions/file-type․lisp file
File, file-type.lisp: The reblocks-auth/models/file-type․lisp file
File, file-type.lisp: The reblocks-auth/errors/file-type․lisp file
File, file-type.lisp: The reblocks-auth/github/file-type․lisp file
File, file-type.lisp: The reblocks-auth/providers/email/processing/file-type․lisp file
File, file-type.lisp: The reblocks-auth/providers/email/models/file-type․lisp file
File, file-type.lisp: The reblocks-auth/providers/email/mailgun/file-type․lisp file
File, reblocks-auth.asd: The reblocks-auth/reblocks-auth․asd file
file-type.lisp: The reblocks-auth/core/file-type․lisp file
file-type.lisp: The reblocks-auth/button/file-type․lisp file
file-type.lisp: The reblocks-auth/auth/file-type․lisp file
file-type.lisp: The reblocks-auth/utils/file-type․lisp file
file-type.lisp: The reblocks-auth/conditions/file-type․lisp file
file-type.lisp: The reblocks-auth/models/file-type․lisp file
file-type.lisp: The reblocks-auth/errors/file-type․lisp file
file-type.lisp: The reblocks-auth/github/file-type․lisp file
file-type.lisp: The reblocks-auth/providers/email/processing/file-type․lisp file
file-type.lisp: The reblocks-auth/providers/email/models/file-type․lisp file
file-type.lisp: The reblocks-auth/providers/email/mailgun/file-type․lisp file

L
login-processor: Public classes
logout-processor: Public classes

N
new-accounts-are-prohibited: Private conditions
nickname-is-not-available: Public conditions

P
Package, reblocks-auth/auth: The reblocks-auth/auth package
Package, reblocks-auth/button: The reblocks-auth/button package
Package, reblocks-auth/conditions: The reblocks-auth/conditions package
Package, reblocks-auth/core: The reblocks-auth/core package
Package, reblocks-auth/errors: The reblocks-auth/errors package
Package, reblocks-auth/github: The reblocks-auth/github package
Package, reblocks-auth/models: The reblocks-auth/models package
Package, reblocks-auth/providers/email/mailgun: The reblocks-auth/providers/email/mailgun package
Package, reblocks-auth/providers/email/models: The reblocks-auth/providers/email/models package
Package, reblocks-auth/providers/email/processing: The reblocks-auth/providers/email/processing package
Package, reblocks-auth/utils: The reblocks-auth/utils package

R
reblocks-auth: The reblocks-auth system
reblocks-auth.asd: The reblocks-auth/reblocks-auth․asd file
reblocks-auth/auth: The reblocks-auth/auth system
reblocks-auth/auth: The reblocks-auth/auth package
reblocks-auth/button: The reblocks-auth/button system
reblocks-auth/button: The reblocks-auth/button package
reblocks-auth/conditions: The reblocks-auth/conditions system
reblocks-auth/conditions: The reblocks-auth/conditions package
reblocks-auth/core: The reblocks-auth/core system
reblocks-auth/core: The reblocks-auth/core package
reblocks-auth/errors: The reblocks-auth/errors system
reblocks-auth/errors: The reblocks-auth/errors package
reblocks-auth/github: The reblocks-auth/github system
reblocks-auth/github: The reblocks-auth/github package
reblocks-auth/models: The reblocks-auth/models system
reblocks-auth/models: The reblocks-auth/models package
reblocks-auth/providers/email/mailgun: The reblocks-auth/providers/email/mailgun system
reblocks-auth/providers/email/mailgun: The reblocks-auth/providers/email/mailgun package
reblocks-auth/providers/email/models: The reblocks-auth/providers/email/models system
reblocks-auth/providers/email/models: The reblocks-auth/providers/email/models package
reblocks-auth/providers/email/processing: The reblocks-auth/providers/email/processing system
reblocks-auth/providers/email/processing: The reblocks-auth/providers/email/processing package
reblocks-auth/utils: The reblocks-auth/utils system
reblocks-auth/utils: The reblocks-auth/utils package
registration-code: Public classes
request-code-form: Public classes
request-code-form-for-popup: Private classes
request-code-popup: Private classes

S
social-profile: Public classes
System, reblocks-auth: The reblocks-auth system
System, reblocks-auth/auth: The reblocks-auth/auth system
System, reblocks-auth/button: The reblocks-auth/button system
System, reblocks-auth/conditions: The reblocks-auth/conditions system
System, reblocks-auth/core: The reblocks-auth/core system
System, reblocks-auth/errors: The reblocks-auth/errors system
System, reblocks-auth/github: The reblocks-auth/github system
System, reblocks-auth/models: The reblocks-auth/models system
System, reblocks-auth/providers/email/mailgun: The reblocks-auth/providers/email/mailgun system
System, reblocks-auth/providers/email/models: The reblocks-auth/providers/email/models system
System, reblocks-auth/providers/email/processing: The reblocks-auth/providers/email/processing system
System, reblocks-auth/utils: The reblocks-auth/utils system

U
unable-to-authenticate: Public conditions
user: Public classes