Shutdown server after two minutes of inactivity

This commit is contained in:
adrienperonnet 2019-04-26 23:09:01 +12:00
parent 44a6d7756d
commit 6b4cfa3d05

View File

@ -242,5 +242,8 @@ func (p ProviderConfig) Authenticate(t *OAuth2Token) error {
t.TokenType = res.TokenType
t.IDToken = IDToken
return nil
case <-time.After(2 * time.Minute):
server.Shutdown(ctx)
return errors.New("no oauth2 flow callback received within last 2 minutes, exiting")
}
}