Skip to content

Commit

Permalink
Merge pull request #2 from mladBlum/feature/WithEmailPassword
Browse files Browse the repository at this point in the history
Add possibility to login  with any collection of type auth
  • Loading branch information
pluja authored Mar 15, 2024
2 parents 61deff4 + 905aacb commit 6bd0553
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ func WithUserEmailPassword(email, password string) ClientOption {
}
}

func WithUserEmailPasswordAndCollection(email, password, collection string) ClientOption {
return func(c *Client) {
c.authorizer = newAuthorizeEmailPassword(c.client, c.url+"/api/collections/"+collection+"/auth-with-password", email, password)
}
}

func WithAdminToken(token string) ClientOption {
return func(c *Client) {
c.authorizer = newAuthorizeToken(c.client, c.url+"/api/admins/auth-refresh", token)
Expand Down

0 comments on commit 6bd0553

Please sign in to comment.