Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
metalurgical committed Jun 12, 2024
1 parent 0dc9da3 commit d66f90c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 15 deletions.
8 changes: 5 additions & 3 deletions Sources/CustomAuth/Handlers/DiscordLoginHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ class DiscordLoginHandler: AbstractLoginHandler {
override public func setFinalUrl() throws {
var urlComponents = URLComponents()

var params: [String: String] = if jwtParams != nil { try (JSONSerialization.jsonObject(with: try JSONEncoder().encode(jwtParams), options: []) as! [String: String])
} else {
[:]
var params: [String: String] = [:]

if jwtParams != nil {
params = try (JSONSerialization.jsonObject(with: try JSONEncoder().encode(jwtParams), options: []) as! [String: String])
}

params.merge([
"state": try state(),
"response_type": response_type,
Expand Down
8 changes: 5 additions & 3 deletions Sources/CustomAuth/Handlers/FacebookLoginHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ class FacebookLoginHandler: AbstractLoginHandler {
override public func setFinalUrl() throws {
var urlComponents = URLComponents()

var params: [String: String] = if jwtParams != nil { try (JSONSerialization.jsonObject(with: try JSONEncoder().encode(jwtParams), options: []) as! [String: String])
} else {
[:]
var params: [String: String] = [:]

if jwtParams != nil {
params = try (JSONSerialization.jsonObject(with: try JSONEncoder().encode(jwtParams), options: []) as! [String: String])
}

params.merge([
"state": try state(),
"response_type": response_type,
Expand Down
8 changes: 5 additions & 3 deletions Sources/CustomAuth/Handlers/GoogleLoginHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ class GoogleLoginHandler: AbstractLoginHandler {
override public func setFinalUrl() throws {
var urlComponents = URLComponents()

var params: [String: String] = if jwtParams != nil { try (JSONSerialization.jsonObject(with: try JSONEncoder().encode(jwtParams), options: []) as! [String: String])
} else {
[:]
var params: [String: String] = [:]

if jwtParams != nil {
params = try (JSONSerialization.jsonObject(with: try JSONEncoder().encode(jwtParams), options: []) as! [String: String])
}

params.merge([
"state": try state(),
"response_type": response_type,
Expand Down
8 changes: 5 additions & 3 deletions Sources/CustomAuth/Handlers/RedditLoginHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ class RedditLoginHandler: AbstractLoginHandler {
override public func setFinalUrl() throws {
var urlComponents = URLComponents()

var params: [String: String] = if jwtParams != nil { try (JSONSerialization.jsonObject(with: try JSONEncoder().encode(jwtParams), options: []) as! [String: String])
} else {
[:]
var params: [String: String] = [:]

if jwtParams != nil {
params = try (JSONSerialization.jsonObject(with: try JSONEncoder().encode(jwtParams), options: []) as! [String: String])
}

params.merge([
"state": try state(),
"response_type": response_type,
Expand Down
8 changes: 5 additions & 3 deletions Sources/CustomAuth/Handlers/TwitchLoginHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ class TwitchLoginHandler: AbstractLoginHandler {
override public func setFinalUrl() throws {
var urlComponents = URLComponents()

var params: [String: String] = if jwtParams != nil { try (JSONSerialization.jsonObject(with: try JSONEncoder().encode(jwtParams), options: []) as! [String: String])
} else {
[:]
var params: [String: String] = [:]

if jwtParams != nil {
params = try (JSONSerialization.jsonObject(with: try JSONEncoder().encode(jwtParams), options: []) as! [String: String])
}

params.merge([
"state": try state(),
"response_type": response_type,
Expand Down

0 comments on commit d66f90c

Please sign in to comment.