chore(auth): connect azure user lookup
This commit is contained in:
parent
42ecc91c22
commit
bee135ab48
@ -57,23 +57,21 @@ azureUserPreferredLanguage = "preferredLanguage"
|
|||||||
|
|
||||||
-- | User lookup in Microsoft Graph with given credentials
|
-- | User lookup in Microsoft Graph with given credentials
|
||||||
azureUser :: ( MonadMask m
|
azureUser :: ( MonadMask m
|
||||||
, MonadUnliftIO m
|
, MonadHandler m
|
||||||
-- , MonadThrow m
|
|
||||||
)
|
)
|
||||||
=> AzureConf
|
=> AzureConf
|
||||||
-> Creds site
|
-> Creds site
|
||||||
-> m [(Text, [ByteString])] -- (Either AzureUserException [(Text, [ByteString])])
|
-> m [(Text, [ByteString])] -- (Either AzureUserException [(Text, [ByteString])])
|
||||||
azureUser _conf _creds = fmap throwLeft . liftIO . runExceptT $ do
|
azureUser _conf Creds{..} = fmap throwLeft . runExceptT $ do
|
||||||
results <- return [] -- TODO
|
results <- queryOAuth2User @[(Text, [ByteString])] credsIdent
|
||||||
case results of
|
case results of
|
||||||
[] -> throwE AzureUserNoResult
|
Left _ -> throwE AzureUserNoResult
|
||||||
[res] -> return res
|
Right [res] -> return res
|
||||||
_multiple -> throwE AzureUserAmbiguous
|
Right _multiple -> throwE AzureUserAmbiguous
|
||||||
|
|
||||||
-- | User lookup in Microsoft Graph with given user
|
-- | User lookup in Microsoft Graph with given user
|
||||||
azureUser' :: ( MonadMask m
|
azureUser' :: ( MonadMask m
|
||||||
, MonadUnliftIO m
|
, MonadHandler m
|
||||||
-- , MonadThrow m
|
|
||||||
)
|
)
|
||||||
=> AzureConf
|
=> AzureConf
|
||||||
-> User
|
-> User
|
||||||
|
|||||||
Reference in New Issue
Block a user