@@ -24,22 +24,22 @@ enum LoginController {
2424 let user = try req. content. decode ( UserCreds . self)
2525 let response = try await cognito. authenticate ( req: req, username: user. email, password: user. password)
2626 switch response {
27- case . authenticated( let authenticatedResponse) :
28- let user = AuthenticatedUser ( accessToken: authenticatedResponse. accessToken!)
29- req. auth. login ( user)
30- case . challenged( _) : // Cognito is not configured to send challenges, so we should never receive this response.
31- break
27+ case . authenticated( let authenticatedResponse) :
28+ let user = AuthenticatedUser ( accessToken: authenticatedResponse. accessToken!)
29+ req. auth. login ( user)
30+ case . challenged( _) : // Cognito is not configured to send challenges, so we should never receive this response.
31+ break
3232 }
3333 return req. redirect ( to: SiteURL . portal. relativeURL ( ) , redirectType: . normal)
3434 } catch let error as SotoCognitoError {
3535 var model = Login . Model ( errorMessage: " There was an error. Please try again. " )
3636 switch error {
37- case . unauthorized( let reason) :
38- model = Login . Model ( errorMessage: reason ?? " There was an error. Please try again. " )
39- case . unexpectedResult( let reason) :
40- model = Login . Model ( errorMessage: reason ?? " There was an error. Please try again. " )
41- case . invalidPublicKey:
42- break
37+ case . unauthorized( let reason) :
38+ model = Login . Model ( errorMessage: reason ?? " There was an error. Please try again. " )
39+ case . unexpectedResult( let reason) :
40+ model = Login . Model ( errorMessage: reason ?? " There was an error. Please try again. " )
41+ case . invalidPublicKey:
42+ break
4343 }
4444 return Login . View ( path: req. url. path, model: model) . document ( ) . encodeResponse ( status: . unauthorized)
4545 } catch let error as AWSClientError {
0 commit comments