Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle case when user has revoked osm token #29

Open
kamicut opened this issue Jul 9, 2019 · 0 comments
Open

Handle case when user has revoked osm token #29

kamicut opened this issue Jul 9, 2019 · 0 comments

Comments

@kamicut
Copy link
Member

kamicut commented Jul 9, 2019

When the user authenticates to the app using their OSM credentials, we save their login in a session with hydra using remember_for:

osm-teams/app/lib/osm.js

Lines 80 to 87 in 381dee5

redirect: function (url, status) { res.redirect(url) },
success: function (user) {
if (challenge) {
hydra.acceptLoginRequest(challenge, {
subject: user.id,
remember: true,
remember_for: 9999
}).then(response => {

When a new login request comes in, we check if we can skip the login in

if (skip) {
const { redirect_to } = await hydra.acceptLoginRequest(challenge, { subject })
res.redirect(redirect_to)
} else {

However we need to check if the user token is still valid before skipping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants