View Source PowAssent.Plug.Reauthorization (PowAssent v0.4.13)
This plug can reauthorize a user who signed in through a provider.
The plug is dependent on a
:handler that has the following methods:
reauthorize?/2- verifies the request for reauthorization condition. If the condition exists for the request (usually the sign in path), the reauthorization cookie will be fetched and deleted, the
reauthorize/2callback will be called, and the connection halted.
clear_reauthorization?/2- verifies the request for clear reauthorization condition. If the condition exists (usually the session delete path) then the cookie is deleted.
reauthorize/3- the callback to handle the request when a reauthorization condition exists. Usually this would redirect the user.
PowAssent.Phoenix.ReauthorizationPlugHandler for a Phoenix example.
plug PowAssent.Plug.Reauthorization, handler: MyApp.ReauthorizationHandler
:handler- the handler module. Should either be a module or a tuple
:reauthorization_cookie_key- reauthorization key name. This defaults to "authorization_provider". If
:otp_appis used it'll automatically prepend the key with the
:reauthorization_cookie_opts- keyword list of cookie options, see
Plug.Conn.put_resp_cookie/4for options. The default options are
[max_age: max_age, path: "/"]where
:max_ageis 30 days.