Fix double login problem (closes #56)
This commit is contained in:
parent
a1c9abbdb5
commit
216f2b8106
1 changed files with 13 additions and 5 deletions
|
@ -212,11 +212,19 @@ instance YesodAuth App where
|
|||
, " added to your account."
|
||||
]
|
||||
redirect ProfileR
|
||||
Just _ -> invalidArgs $ return $ concat
|
||||
[ "The email address "
|
||||
, credsIdent creds
|
||||
, " is already associated with a different account."
|
||||
]
|
||||
Just (Entity _ email)
|
||||
| emailUser email == uid -> return $ do
|
||||
setMessage $ toHtml $ concat
|
||||
[ "The email address "
|
||||
, credsIdent creds
|
||||
, " is already part of your account"
|
||||
]
|
||||
redirect ProfileR
|
||||
| otherwise -> invalidArgs $ return $ concat
|
||||
[ "The email address "
|
||||
, credsIdent creds
|
||||
, " is already associated with a different account."
|
||||
]
|
||||
where
|
||||
handleBase = takeWhile (/= '@') (credsIdent creds)
|
||||
getHandle cnt | cnt > 50 = error "Could not get a unique slug"
|
||||
|
|
Loading…
Reference in a new issue