Class: Cats::Core::TokenAuthService

Inherits:
Object
  • Object
show all
Defined in:
app/services/cats/core/token_auth_service.rb

Constant Summary collapse

AUTH_SECRET =
"592fac227e8ee4ff985e376d554604f36c974b4f4605eb8d7ebe4dd1cf8fd8aa8e0cb85df1b48a8ec60cac7bb4117d854" \
"5c359123e14f6784dcd88e6e6a1ea8c".freeze

Class Method Summary collapse

Class Method Details

.auth_secretObject



15
16
17
# File 'app/services/cats/core/token_auth_service.rb', line 15

def self.auth_secret
  AUTH_SECRET
end

.decode(token) ⇒ Object



11
12
13
# File 'app/services/cats/core/token_auth_service.rb', line 11

def self.decode(token)
  JWT.decode(token, auth_secret, true, algorithm: "HS256").first
end

.issue(payload) ⇒ Object



7
8
9
# File 'app/services/cats/core/token_auth_service.rb', line 7

def self.issue(payload)
  JWT.encode(payload, auth_secret, "HS256")
end