Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class System {
- let authorizer: Authorizer
- var authorizedUser: User?
- init(with authorizer: Authorizer) {
- self.authorizer = authorizer
- }
- func recheckAuthorizedUser() {
- guard let user = authorizedUser else {
- return
- }
- if !authorizer.authorize(username: user.username, password: user.password) {
- // redirect to login page
- }
- }
- }
Add Comment
Please, Sign In to add comment