Skip to content

Commit 86138d4

Browse files
committed
Move create_token in user concern out of included
1 parent 74ec935 commit 86138d4

File tree

1 file changed

+9
-9
lines changed
  • app/models/devise_token_auth/concerns

1 file changed

+9
-9
lines changed

app/models/devise_token_auth/concerns/user.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,19 @@ def send_unlock_instructions(opts = {})
8888
send_devise_notification(:unlock_instructions, raw, opts)
8989
raw
9090
end
91+
end
9192

92-
def create_token(client: nil, lifespan: nil, cost: nil, **token_extras)
93-
token = DeviseTokenAuth::TokenFactory.create(client: client, lifespan: lifespan, cost: cost)
93+
def create_token(client: nil, lifespan: nil, cost: nil, **token_extras)
94+
token = DeviseTokenAuth::TokenFactory.create(client: client, lifespan: lifespan, cost: cost)
9495

95-
tokens[token.client] = {
96-
token: token.token_hash,
97-
expiry: token.expiry
98-
}.merge!(token_extras)
96+
tokens[token.client] = {
97+
token: token.token_hash,
98+
expiry: token.expiry
99+
}.merge!(token_extras)
99100

100-
clean_old_tokens
101+
clean_old_tokens
101102

102-
token
103-
end
103+
token
104104
end
105105

106106
def valid_token?(token, client = 'default')

0 commit comments

Comments
 (0)