1
0
mirror of https://github.com/volatiletech/authboss.git synced 2025-01-24 05:17:10 +02:00
authboss/user_test.go
Aaron L 1112987bce Rewrite oauth module
- Tried to be clear about OAuth2 vs OAuth in all places.
- Allow users to be locked from OAuth logins (if done manually for some
  reason other than failed logins)
- Cleaned up some docs and wording around the previously very confusing
  (now hopefully only somewhat confusing) oauth2 module.
2018-03-08 18:39:51 -08:00

24 lines
421 B
Go

package authboss
import "testing"
func TestOAuth2PIDs(t *testing.T) {
t.Parallel()
provider := "provider"
uid := "uid"
pid := MakeOAuth2PID(provider, uid)
if pid != "oauth2;;provider;;uid" {
t.Error("pid was wrong:", pid)
}
gotProvider, gotUID := ParseOAuth2PID(pid)
if gotUID != uid {
t.Error("uid was wrong:", gotUID)
}
if gotProvider != provider {
t.Error("provider was wrong:", gotProvider)
}
}